package com.cn.yunhe;

import java.lang.reflect.Field;

public class AnnotationProcessor {
	
    public static void getStudentInfo(Class<?> clazz){
    	
        if(clazz.isAnnotationPresent(Person.class)){
            Person annotation = clazz.getAnnotation(Person.class);
            System.out.println(annotation);
            System.out.println(annotation.age());
            System.out.println(annotation.name());
            String[] hobby = annotation.hobby();
            for(String str : hobby){
                System.out.println(str);
            }
        }
        
        Field[] fields = clazz.getDeclaredFields();

        for(Field field :fields){
            System.out.println("fieldName=" + field.toString());
            if(field.isAnnotationPresent(StudentGender.class)){
                StudentGender annotation = field.getAnnotation(StudentGender.class);
                System.out.println(annotation);
                System.out.println(annotation.gender());
                
                
            }
        }
        
    }
    
}
